// +build !edge

package loader

import (
	"iot-base/common/dbconn"
	"iot-base/common/dbobj"
)

var IDs []string

//LoadByProtocolName 刷新
func loadByProtocolName() []string {
	//var things []dbobj.Thing
	var ids []string
	err := dbconn.DBConnection.Model(&dbobj.Thing{}).Where("protocol_path=? and proxy_thing_id=?", currentName, "").Select("uid").Find(&ids).Error
	if err == nil {
		thingsMap = make(map[string]*mapValue)
		for _, id := range ids {
			//pThing := ids[i]
			thingsMap[id] = &mapValue{
				isReturn: true,
			}
		}
	}
	IDs = ids
	return ids

}
